package com.lucas.rpc.framework.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author: LiuCheng
 * @description:
 * @date: 2023-12-04 14:14
 **/

@Data
@AllArgsConstructor
@NoArgsConstructor
public class RpcResponse implements Serializable {

    private Integer code;

    private String message;

    private Object data;


    public static RpcResponse success(Object data) {
        RpcResponse response = new RpcResponse();
        response.setCode(200);
        response.setMessage("响应成功");
        if (null != data) {
            response.setData(data);
        }
        return response;
    }

}
